#include "dattype_ctrl.h"
#include <QDebug>
DatType_Ctrl::DatType_Ctrl(QWidget *parent) : QLabel(parent)
{

}

void DatType_Ctrl::PopShortcut_Menu(QMouseEvent *e)
{
    QMenu    menu;
    QAction *action;

     action = menu.addAction("1");
     connect(action,&QAction::triggered , this ,[this]()
     {
         qDebug() << this->text();
     });
      menu.exec(e->globalPos());

}

void DatType_Ctrl::mousePressEvent(QMouseEvent *e)
{
    //****************************************呼出快捷选项
    if(e->button() == Qt::RightButton)
    {
        PopShortcut_Menu(e);
    }
    else
    {
        QLabel::mousePressEvent(e);
    }
}
